﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Public;
using BUS;

namespace QuanLyKhoHangVatTu
{
    public partial class ChiTietChuyenKho : DevExpress.XtraEditors.XtraForm
    {
        Flag_PB flag_pb = new Flag_PB();
        ChuyenKho_BUS ck_bus = new ChuyenKho_BUS();
        ChuyenKho_PB ck_pb = new ChuyenKho_PB();
        public ChiTietChuyenKho()
        {
            InitializeComponent();
        }

        private void ChiTietChuyenKho_Load(object sender, EventArgs e)
        {
            Flag_PB.Flag = 11;
            gridChuyenKho.DataSource = ck_bus.LayDSCK();
        }

        private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            string ma = ChuyenKho_PB.MaChuyenKho = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "MACHUYENKHO").ToString();
            gridCTChuyenKho.DataSource = ck_bus.TimMaPhieuChuyenKho(ma);
            ChuyenKho_PB.NgayHachToan = Convert.ToDateTime(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "NGAYHACHTOAN").ToString());
            ChuyenKho_PB.NgayChungTu = Convert.ToDateTime(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "NGAYCHUNGTU").ToString());
            ChuyenKho_PB.NguoiVanChuyen = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "NGUOIVANCHUYEN").ToString();
            ChuyenKho_PB.TenNguoiVanChuyen = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "TENNHANVIEN").ToString();
            ChuyenKho_PB.DienGiai = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "DIENGIAI").ToString();
        }
    }
}